﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class OneQuestion : MonoBehaviour {
    public Text m_NumberText;
    public Text m_StemText;
    public Image m_BGImg;
    public bool m_IsClicked;

    float t1, t2;
	// Use this for initialization
	void Start () {
		
	}
	
	// Update is called once per frame
	void Update () {
		
	}
    public void Init(string num,string stem) {
        m_NumberText.text = "题目"+num+":";
        m_StemText.text = stem;
    }
    public void OnClick() {
        QuestionMgr.s_Instance.OnCickOneQuestion(this);

        t2 = Time.realtimeSinceStartup;
        if(t2-t1 < 0.2f) {
            QuestionMgr.s_Instance.OnClickLoadQuestion();
        }
        t1 = t2;
    }
    public void SetState(bool isclick) {
        m_IsClicked = isclick;
        if (isclick) {
            m_BGImg.color = Color.gray;
        } else {
            m_BGImg.color = Color.white;
        }
    }
    
}
